package com.vastcom.tyauthcenter.model;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;

@Entity
public class Dept {
    private String deptid;
    private String name;
    private String pid;
    private Integer sort;

    @Id
    @Column(name = "deptid")
    public String getDeptid() {
        return deptid;
    }

    public void setDeptid(String deptid) {
        this.deptid = deptid;
    }

    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "pid")
    public String getPid() {
        return pid;
    }

    public void setPid(String pid) {
        this.pid = pid;
    }

    @Basic
    @Column(name = "sort")
    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Dept dept = (Dept) o;

        if (deptid != null ? !deptid.equals(dept.deptid) : dept.deptid != null) return false;
        if (name != null ? !name.equals(dept.name) : dept.name != null) return false;
        if (pid != null ? !pid.equals(dept.pid) : dept.pid != null) return false;
        if (sort != null ? !sort.equals(dept.sort) : dept.sort != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = deptid != null ? deptid.hashCode() : 0;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (pid != null ? pid.hashCode() : 0);
        result = 31 * result + (sort != null ? sort.hashCode() : 0);
        return result;
    }
}
